package com.kzd.btgame.entity

import com.blankj.utilcode.util.GsonUtils
import com.chad.library.adapter.base.entity.MultiItemEntity
import com.module.lemlin.http.HttpResponseData
import java.io.Serializable

data class HomeIndex(
    val title: String? = null,
    val type: Int,
    val list: MutableList<Any> = mutableListOf(),
    val img: String? = null,
    val id: Int = 0,
    val game_layout: String? = null
) : MultiItemEntity {
    override val itemType: Int
        get() = type

    fun <T> getConversionList(type: Class<T>): MutableList<T> {
        if (list.isNullOrEmpty()) {
            return mutableListOf()
        }
        val list2: MutableList<T> = mutableListOf()
        for (elem in list) {
            list2.add(GsonUtils.fromJson(GsonUtils.toJson(elem), type))
        }
        return list2
    }
}

data class HomeNav(
    val icon: String,
    val login: Int,
    val name: String,
    val page: String?,
    val type: Int,
    val id: Int,
    val game_layout: String? = null
)

data class HomeAdv(
    val img: String,
    val page: String
)

data class HomeSort(
    val id: Int,
    val name: String
)

data class HomeFab(
    val id: Int = 0,
    val end_time: Int = 0,
    val img: Any? = null,
    val is_login: Int = 0,
    val url: String? = null,
    val title: String? = null
)

data class Doings<T>(
    val list: MutableList<T> = mutableListOf(),
    val start: Long,
    val top: DoingsTop
) : Serializable

data class DoingsTop(
    val color: String,
    val content: String,
    val image: String,
    val title: String
) : Serializable


data class HomeServiceTodayResponse(
    val data: ServiceTime
) : HttpResponseData()